
**** Cluster (By Stata)

*Abrir Base*
use "INEP - municípios_v12_dea.dta" 

*Padronizar os valores das variáveis selecionadas
egen float zcl_esforco12 = std( cl_esforco12 ), mean(0) std(1)
egen float zcl_rotati_alta = std( cl_rotati_alta ), mean(0) std(1)
egen float zcl_comple_12 = std( cl_comple_12 ), mean(0) std(1)
egen float zcl_ade_doc123 = std( cl_ade_doc123  ), mean(0) std(1)
egen float zcl_remu2 = std(cl_remu), mean(0) std(1)
egen float zcl_infra2 = std( cl_infra ), mean(0) std(1)

*Gerar Cluster
cluster wardslinkage zcl_ade_doc123 zcl_comple_12 zcl_rotati_alta zcl_esforco12 zcl_remu2 zcl_infra2, measure(L2square> d)
cluster name: _clus_1
cluster generate cwz5 = groups(5), name(_clus_1) ties(error)

*Salvar e fechar*
